/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gmovil_jpa.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author castlerock
 */
@Entity
@Table(name = "tipo_articulo")
@NamedQueries({
    @NamedQuery(name = "TipoArticulo.findAll", query = "SELECT t FROM TipoArticulo t"),
    @NamedQuery(name = "TipoArticulo.findByIdTipoArticulo", query = "SELECT t FROM TipoArticulo t WHERE t.idTipoArticulo = :idTipoArticulo"),
    @NamedQuery(name = "TipoArticulo.findByTipoArticulo", query = "SELECT t FROM TipoArticulo t WHERE t.tipoArticulo = :tipoArticulo"),
    @NamedQuery(name = "TipoArticulo.findByObservacion", query = "SELECT t FROM TipoArticulo t WHERE t.observacion = :observacion")})
public class TipoArticulo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_tipo_articulo")
    private Integer idTipoArticulo;
    @Basic(optional = false)
    @Column(name = "tipo_articulo")
    private String tipoArticulo;
    @Column(name = "observacion")
    private String observacion;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tipoArticulo")
    private List<Modelo> modeloList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tipoArticulo")
    private List<AtributoTipoArticulo> atributoTipoArticuloList;

    public TipoArticulo() {
    }

    public TipoArticulo(Integer idTipoArticulo) {
        this.idTipoArticulo = idTipoArticulo;
    }

    public TipoArticulo(Integer idTipoArticulo, String tipoArticulo) {
        this.idTipoArticulo = idTipoArticulo;
        this.tipoArticulo = tipoArticulo;
    }

    public Integer getIdTipoArticulo() {
        return idTipoArticulo;
    }

    public void setIdTipoArticulo(Integer idTipoArticulo) {
        this.idTipoArticulo = idTipoArticulo;
    }

    public String getTipoArticulo() {
        return tipoArticulo;
    }

    public void setTipoArticulo(String tipoArticulo) {
        this.tipoArticulo = tipoArticulo;
    }

    public String getObservacion() {
        return observacion;
    }

    public void setObservacion(String observacion) {
        this.observacion = observacion;
    }

    public List<Modelo> getModeloList() {
        return modeloList;
    }

    public void setModeloList(List<Modelo> modeloList) {
        this.modeloList = modeloList;
    }

    public List<AtributoTipoArticulo> getAtributoTipoArticuloList() {
        return atributoTipoArticuloList;
    }

    public void setAtributoTipoArticuloList(List<AtributoTipoArticulo> atributoTipoArticuloList) {
        this.atributoTipoArticuloList = atributoTipoArticuloList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTipoArticulo != null ? idTipoArticulo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TipoArticulo)) {
            return false;
        }
        TipoArticulo other = (TipoArticulo) object;
        if ((this.idTipoArticulo == null && other.idTipoArticulo != null) || (this.idTipoArticulo != null && !this.idTipoArticulo.equals(other.idTipoArticulo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "gmovil_jpa.entidades.TipoArticulo[idTipoArticulo=" + idTipoArticulo + "]";
    }

}
